UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k5Pt6mFBrgRucg4S5wOHJJkh82cI1ML0HDBY3okHJ78='
WHERE
key_id = '11e7156c5540e0d2d422bf96b3bc69edb51c973a4fcfed72aa64b6c6874f89f7'
AND (
token = 'k5Pt6mFBrgRucg4S5wOHJJkh82cI1ML0HDBY3okHJ78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)