UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CLqJrkWea1dvHHCEycG4h0LzVkT7NZ3Hp1I3iuyaDGg=' 
WHERE 
  key_id = '25e1137b0d53efa535f04bc8a6dd1b75856f616db2ca9cad0262ce883075fdb3' 
  AND (
    token = 'CLqJrkWea1dvHHCEycG4h0LzVkT7NZ3Hp1I3iuyaDGg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032