UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yB/bE6FwB2GIwZfDa8tCmFeJ5qJnYOmrsAV4txAEsF8=' 
WHERE 
  key_id = '8748d23cb8ec257a00fe864e3753d2abd3d033b90259f8348c67e680c4cb1a90' 
  AND (
    token = 'yB/bE6FwB2GIwZfDa8tCmFeJ5qJnYOmrsAV4txAEsF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036