UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OYyWuVuUkPbxhwXVuBnojQ6YOMQoUWpUQ2BrbWym8e0=' 
WHERE 
  key_id = 'f32d2c2c1b7d85161a279064f5b48fc33638f4fbf67c0810fc383efe413d11b9' 
  AND (
    token = 'OYyWuVuUkPbxhwXVuBnojQ6YOMQoUWpUQ2BrbWym8e0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021