UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kb9FBmu2cOSnYPljkPy+8OhGRPt7gtG4urL4obqjhJQ='
WHERE
key_id = '29cefceacb4dc21df051f7290a0a60a45316a9a4c3f955f1c398a72f367ba901'
AND (
token = 'kb9FBmu2cOSnYPljkPy+8OhGRPt7gtG4urL4obqjhJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)