UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qOUJWVS/SUqwAt6/1nkM0dNsnC1eetY4GoE4vcBu5Q4=' 
WHERE 
  key_id = 'ad6bbf37f20cc9ce726f928c28238b319f117bfac5e55795bd36c513558d6d50' 
  AND (
    token = 'qOUJWVS/SUqwAt6/1nkM0dNsnC1eetY4GoE4vcBu5Q4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042