UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uVqG4Fl33zFJ0rhIyFbmwsImfJliE31wG9A7VFiB2/s=' 
WHERE 
  key_id = '7ae0e7dd6ce4028bde33776433822d85c1eb4086a1dfa291ef96840ff8bcdd92' 
  AND (
    token = 'uVqG4Fl33zFJ0rhIyFbmwsImfJliE31wG9A7VFiB2/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053