UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8gJ/uMcNEf7kgRC5qGQv9MF2Ytwv51rxnIJ8NYgjhlA=' 
WHERE 
  key_id = '2503c8b260781e2b09b0406292a50a3a2ced549d24bd2c6318c880b413331922' 
  AND (
    token = '8gJ/uMcNEf7kgRC5qGQv9MF2Ytwv51rxnIJ8NYgjhlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052