UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HO9TJcJPt/KTG8/nppvZzmUW+LIxt+QYErIuIGjQjws='
WHERE
key_id = '6219510fb51fc1c98b62f32c6d76b5ca4f459bc5807bfcd86e3407b60639ae7e'
AND (
token = 'HO9TJcJPt/KTG8/nppvZzmUW+LIxt+QYErIuIGjQjws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)