UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vdBallq+JYk8UTJR+IYT9qcPVfsfhYZuNKa2gNYhx2c='
WHERE
key_id = 'df5968e5aa2a13b091e8f137723c8850414e8ffdfdfc2e413940952c7a6897c5'
AND (
token = 'vdBallq+JYk8UTJR+IYT9qcPVfsfhYZuNKa2gNYhx2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)