UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UXkE18PofzQzxXTzOGLr7x9xbP2JQq3FBmsBwlHnYBY='
WHERE
key_id = '34752c12fd89915f8c59789ee1f7d4c5280d1d888726cb3ffff783effcfafcb3'
AND (
token = 'UXkE18PofzQzxXTzOGLr7x9xbP2JQq3FBmsBwlHnYBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)