UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wBFDSwciWCb6DBUc2bg+Gxt3EItnOH8FyRHUh3Ujbo0='
WHERE
key_id = '3bf241bb062019fb5bb8a35947cd260e6588be03413f41f195f27bf524866047'
AND (
token = 'wBFDSwciWCb6DBUc2bg+Gxt3EItnOH8FyRHUh3Ujbo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)