UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TVIXZCoxl+9qecm4ZxxTA8PVBobWkNS3S5XUrRsN/L0=' 
WHERE 
  key_id = '4a8bee708dd2f84bed5e82bb49ae97e0e06eba76b04afcaf91a48c02cee9a0e6' 
  AND (
    token = 'TVIXZCoxl+9qecm4ZxxTA8PVBobWkNS3S5XUrRsN/L0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031