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