UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NiD9GzpQ63z3WImDXHDSaaV/8qGS/3qkyR9fnTkUGzI=' 
WHERE 
  key_id = '76335f137b3fab75b898fe61c78bb19a8a9a05628924e1ef92dd2e34d7c0f26b' 
  AND (
    token = 'NiD9GzpQ63z3WImDXHDSaaV/8qGS/3qkyR9fnTkUGzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034