UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MnrHddREJTTcxDPe1IGRPDzhRBYvuH2HChtWeARBlXE='
WHERE
key_id = '5d29addc09bd8e0f400acbcf94ab953d32a8f4d3824ece85c3b759b4bd2d50a1'
AND (
token = 'MnrHddREJTTcxDPe1IGRPDzhRBYvuH2HChtWeARBlXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)