UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ckMfvTvTacveHZFOhwv0oOhJAaMYSai+i+Bw157lWcg='
WHERE
key_id = '69a3db09a904a5582ec5645f55766a84dae968db554556b06143a3ea06a6f545'
AND (
token = 'ckMfvTvTacveHZFOhwv0oOhJAaMYSai+i+Bw157lWcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)