UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '85/wqtsGKO5PR84VL+dWeFehSGQtMoSk8Cyb2JsAUEA=' 
WHERE 
  key_id = 'ed759f3c65bc7bd92abf4e65c8dab9499663d14410b6ee56411d2dcaaea97c9d' 
  AND (
    token = '85/wqtsGKO5PR84VL+dWeFehSGQtMoSk8Cyb2JsAUEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061