UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ETQVB8AcnUttBy+UJCGQRPoFu2WQRiNiqFlAfZCtJeg='
WHERE
key_id = 'd1bb08efeac88f565ae5a58b3e887fdb02a75aee803f71a9bf641a99bc7a4a2b'
AND (
token = 'ETQVB8AcnUttBy+UJCGQRPoFu2WQRiNiqFlAfZCtJeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)