UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CC2/kJ2h+kTuTnrcW5xOfzdLh3G6+GLPkLpByZPunv0=' 
WHERE 
  key_id = '8fee19fd7de8ba7f9bcf1fac6e73ab342933f33c955e15c6adf3ac1695cd4217' 
  AND (
    token = 'CC2/kJ2h+kTuTnrcW5xOfzdLh3G6+GLPkLpByZPunv0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015