UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hSV3PS/Mw2buIXjA9I8a5UYYAsBstZV6PJwelImR9hE='
WHERE
key_id = 'ea0bab7225b90e6ebb482ecc92062da2cd7d0c7f3def5762f960d902b9484954'
AND (
token = 'hSV3PS/Mw2buIXjA9I8a5UYYAsBstZV6PJwelImR9hE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)