UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's/fpyJzKtiH9uHVCQkx/cKX5ychhGFrqXBR7qSl8mwg='
WHERE
key_id = 'f4bdeedeccafb735c4c1eb6c7e8a5c77f6e497c220a2f9819e338a81fd966810'
AND (
token = 's/fpyJzKtiH9uHVCQkx/cKX5ychhGFrqXBR7qSl8mwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)