UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z+B/JWg5jQJ9i7G554//5fnSuCqhBpxgDkIDg27gQgo='
WHERE
key_id = 'c6839364712741a4111ab51e333c9b4f321944c702a2327d6c8401bb71775ab7'
AND (
token = 'Z+B/JWg5jQJ9i7G554//5fnSuCqhBpxgDkIDg27gQgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)