UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yFo8vIK37tc9X3zq5c2hM4oBVN8dDYO/epNpzlPWbRQ=' 
WHERE 
  key_id = 'cb2e60ad74366b802e8d69ba5fb5a181897b1dd56b6e74b67028dae1ae8a8035' 
  AND (
    token = 'yFo8vIK37tc9X3zq5c2hM4oBVN8dDYO/epNpzlPWbRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027