UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PWvC0w9fTY5DIG/QR10JPurje5R+esBsyxMJKtyDNFQ=' 
WHERE 
  key_id = '927a55ce8d4de767f814422f5c0729dd0830695236fbffb76955a1c9d7063289' 
  AND (
    token = 'PWvC0w9fTY5DIG/QR10JPurje5R+esBsyxMJKtyDNFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029