UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IlYauPZvxrYyu8Xt+WhZmS+wMGASiegEpJIORL+Xsjg=' 
WHERE 
  key_id = '6b2ee63d3f58ca009a848e23921b19da70c5e15b022e57ecebaeb9013cecf3ea' 
  AND (
    token = 'IlYauPZvxrYyu8Xt+WhZmS+wMGASiegEpJIORL+Xsjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045