UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvoy0AwAzf8wkcKFpq+205opL6vsy9TRF84IIrebOM0=' 
WHERE 
  key_id = '654b166a22e61a7a82b869cf731c0d75f472370d625c02286c76e562b6d60dbc' 
  AND (
    token = 'xvoy0AwAzf8wkcKFpq+205opL6vsy9TRF84IIrebOM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030