UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tiSIgC7xypnQUVv0RmCA0iyqpLiTtBOv4608nc6t/AY=' 
WHERE 
  key_id = '78bec79b1874afb32818f42e4377cc608916fb5b0d37d7e5dce23cd8bf9e51ac' 
  AND (
    token = 'tiSIgC7xypnQUVv0RmCA0iyqpLiTtBOv4608nc6t/AY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048