UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RDHFSHgV5qa3cssX+k0T/C5jRVN8/p5FceaEBDavjXE=' 
WHERE 
  key_id = 'cee672e44fa70d9a2e82050dd88430d70608325e93f4a8a00644836e721cc130' 
  AND (
    token = 'RDHFSHgV5qa3cssX+k0T/C5jRVN8/p5FceaEBDavjXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046