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