UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Auoh4apmQ5pS9dQ/kEsiF9Bmux2/pRWpmpf7oaAPymI='
WHERE
key_id = 'bf3229b557612898bb23ce06b82df592a682a05d3eedd2d0ecacc3072812daeb'
AND (
token = 'Auoh4apmQ5pS9dQ/kEsiF9Bmux2/pRWpmpf7oaAPymI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)