UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uEDDHTcZEw4y0hdxWtmOfvjYyOJj1FWiDSDKs6oHrTY='
WHERE
key_id = '94fcd0eb3d097dbdcbb8c99d0c50b947513bcd23b2ddd79042e7c25aa6d126d7'
AND (
token = 'uEDDHTcZEw4y0hdxWtmOfvjYyOJj1FWiDSDKs6oHrTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)