UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JWUhkx6BQPYOPrFx+CA4WK+jsvMGFLWHlegsvQ9RPAE=' 
WHERE 
  key_id = '2d9efdfb25c11b80893939334cb36fd29d346e19420c21a8b61a027bf7f1e1b3' 
  AND (
    token = 'JWUhkx6BQPYOPrFx+CA4WK+jsvMGFLWHlegsvQ9RPAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023