UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ywXAcAFzL+2GtD6yosbETCxnr0eXJSfK97U+DX7jmi4='
WHERE
key_id = '545c5681920cca74930a49c2b5ebf4e2c6df2327547b98edec4fc4613256d0a2'
AND (
token = 'ywXAcAFzL+2GtD6yosbETCxnr0eXJSfK97U+DX7jmi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)