UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LAryMlmqQQ+uBSxea8LA4z8EQtYDuNPm85xml76E29A='
WHERE
key_id = '159408e2bf59a0fb7a699687e95740b5abc2470da586d75d168bd59c1dc9b3a2'
AND (
token = 'LAryMlmqQQ+uBSxea8LA4z8EQtYDuNPm85xml76E29A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)