UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJJTGp7bj7ffW9wkRmLerHgHm48+v6RtquK75sfcTNY='
WHERE
key_id = 'abacdb23dd52264cd8ce5c4754e00a6135c4764b672fa758af8e493e488bbad9'
AND (
token = 'MJJTGp7bj7ffW9wkRmLerHgHm48+v6RtquK75sfcTNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)