UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hB60T7UeHDVZMF92T1I1ztohtGo2Uv3yzAE6wAPfrGA=' 
WHERE 
  key_id = 'ec3082a9f1c45195d08640f5c70029f445ffba25e1791038a290de2f096c3fa7' 
  AND (
    token = 'hB60T7UeHDVZMF92T1I1ztohtGo2Uv3yzAE6wAPfrGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048