UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VKPS55DyGdNevkfKwogs8/O3zRbwJl60gllx3/ioELg='
WHERE
key_id = '9718a6f1aaf6c6b82d98d21beafc12bf4669073c1458c0230e0c6067d09a1910'
AND (
token = 'VKPS55DyGdNevkfKwogs8/O3zRbwJl60gllx3/ioELg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)