UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gFOUXKNpdPaNriwoYETX6PWXcqlDACsHzPRbYxoc3FI='
WHERE
key_id = 'cc53c04280b73167541b6a3929ed705738233d0cd35b953bad8cc69a7ba7f773'
AND (
token = 'gFOUXKNpdPaNriwoYETX6PWXcqlDACsHzPRbYxoc3FI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)