UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0uqbasgpiB3jlQwMnfL2+/YTOYXm4CwDddzhEJKrfQY='
WHERE
key_id = '41f78d5a37039e762d976fd98b679e4149449b8f68e62f6056f97614151ca957'
AND (
token = '0uqbasgpiB3jlQwMnfL2+/YTOYXm4CwDddzhEJKrfQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)