UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LdO9qiI7LqSwIlmpvnuQAY09QNSZYlPAYJ85M4WCUB8='
WHERE
key_id = '8a70d2b0b0db080126669fb22dfae302567f963841ac656ab88f29f852e1beb3'
AND (
token = 'LdO9qiI7LqSwIlmpvnuQAY09QNSZYlPAYJ85M4WCUB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)