UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G2eX3D1HYDX27guQ3rwWkOM3ojzTOnr0pVuPKrTWL/Y=' 
WHERE 
  key_id = '395c6f26ba60a908407f3896e6ae0231ccd98cfbea03fb0b0b7a8ffd85b4aaa6' 
  AND (
    token = 'G2eX3D1HYDX27guQ3rwWkOM3ojzTOnr0pVuPKrTWL/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017