UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v2A/UzEcfPuPB2ozrHwE/DqmoiE1Nzxp4iGRrRsXnyI=' 
WHERE 
  key_id = '2fb3010c18a38d6149899a5d69655699574124fb60cb8a78ab1341669982249f' 
  AND (
    token = 'v2A/UzEcfPuPB2ozrHwE/DqmoiE1Nzxp4iGRrRsXnyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034